package com.flying.rp.chapter3.model;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.mongodb.annotations.Immutable;
import lombok.*;
import org.bson.types.ObjectId;
import org.springframework.data.annotation.Id;
import org.springframework.data.mongodb.core.mapping.Document;

import java.util.Date;

@Document
@Data
@AllArgsConstructor
@NoArgsConstructor
@Immutable
@Builder
public class News {
    @Id
    @JsonIgnore
    private ObjectId id;

    @NonNull
    private String title;
    @NonNull
    private String content;
    @NonNull
    private Date publishedOn;
    @NonNull
    private String category;
    @NonNull
    private String author;

}
